package com.xinqi.modules.chat.chat.rongyun;

import com.xinqi.common.base.constants.ServiceNameConstants;
import com.xinqi.common.base.response.R;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;


@FeignClient(contextId = "remoteRongyunClient", value = ServiceNameConstants.XQ_CHAT)
public interface RemoteRongyunClient {

    /**
     * 用户注册融云
     */
    @GetMapping("/inner/rongyun/registUser")
    R<String> registUser(@RequestParam(value = "userId") String userId, @RequestParam(value = "userName") String userName, @RequestParam(value = "avatar") String avatar);

    /**
     * 刷新用户信息
     */
    @GetMapping("/inner/rongyun/updateUser")
    R<Boolean> updateUser(@RequestParam(value = "userId") String userId, @RequestParam(value = "userName") String userName, @RequestParam(value = "avatar") String avatar);

    /**
     * 发送系统消息
     *
     * @param targetIds
     * @param json
     * @return
     */
    @GetMapping("/inner/rongyun/creatSend")
    R<Boolean> creatSend(@RequestParam(value = "targetIds") String[] targetIds, @RequestParam(value = "json") String json);

    /**
     * 发送系统用户消息
     *
     * @param targetIds
     * @param json
     * @return
     */
    @GetMapping("/inner/rongyun/creatSysUserSend")
    R<Boolean> creatSysUserSend(@RequestParam(value = "targetIds") String[] targetIds, @RequestParam(value = "json") String json);

    /**
     * 融云封禁
     *
     * @param userId
     * @param minute 封禁时长，单位为分钟，最大值为 43200 分钟。
     * @return
     */
    @GetMapping("/inner/rongyun/ban")
    R<Boolean> ban(@RequestParam(value = "userId") String userId, @RequestParam(value = "minute") Integer minute);

}
